package com.asset.dispoal.file.clouddesk;

import com.asset.dispoal.file.clouddesk.api.CloudDeskService;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskAddRequest;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskDelRequest;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskQueryRequest;
import com.asset.dispoal.file.clouddesk.dto.CloudDeskQueryResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;

import java.util.List;

@RestController
@Api(value = "云盘管理", tags = "云盘管理")
@RequestMapping("file/clouddesk")
public class CloudDeskController {

    @Autowired
    private CloudDeskService cloudDeskService;

    @ApiOperation(value = "云盘查询", notes = "云盘查询")
    @GetMapping("query")
    public Result<List<CloudDeskQueryResponse>> query(CloudDeskQueryRequest request) {
        return cloudDeskService.query(request);
    }

    @ApiOperation(value = "云盘创建", notes = "云盘创建")
    @PostMapping("create")
    public Result create(CloudDeskAddRequest request) {
        return cloudDeskService.create(request);
    }

    @ApiOperation(value = "云盘删除", notes = "云盘删除")
    @DeleteMapping("delete")
    public Result delete(CloudDeskDelRequest request) {
        return cloudDeskService.delete(request);
    }
}
